package com.wangyadong.hobby.schedule.jobtask.tree.example1;

import com.wangyadong.hobby.schedule.jobtask.tree.Position;

public abstract class AbstarctTree<E> implements Tree<E> {
    @Override
    public boolean isEmpty() {
        return size() == 0;
    }

    @Override
    public boolean isExternal(Position p) throws IllegalArgumentException {
        return childNum(p) == 0;
    }

    @Override
    public boolean isInternal(Position p) throws IllegalArgumentException {
        return childNum(p) > 0;
    }
}
